package com.sk.bilibili.adapter.pager.live;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.sk.bilibili.adapter.pager.BaseFragmentAdapter;
import com.sk.bilibili.bean.Live;
import com.sk.bilibili.view.fragment.BaseFragment;
import com.sk.bilibili.view.fragment.live.HistoryFragment;
import com.sk.bilibili.view.fragment.live.InteractiveFragment;
import com.sk.bilibili.view.fragment.live.RecommendFragment;

public class LiveFragmentAdapter extends BaseFragmentAdapter {

    private Live live;

    public LiveFragmentAdapter(@NonNull FragmentManager fm, Live live) {
        super(fm);
        this.live=live;
        initData();
    }

    @Override
    protected String[] getTitles() {
        return "互动,相关推荐,观看历史".split(",");
    }

    @Override
    protected Fragment[] getFragments() {
        Fragment[] fragments=new Fragment[3];
        fragments[0]=new InteractiveFragment(live.getId());
        fragments[1]=new RecommendFragment(live.getLiveTypeId());
        fragments[2]=new HistoryFragment();
        return fragments;
    }

}